package com.ruoyi.framework.utils;

import com.ruoyi.common.utils.spring.SpringUtils;

public class CurrentRequestContext {
    /**
     * 判断是否为开发环境
     * @return
     */
    public static boolean isDev() {
        return isEnvironment("dev");
    }
    public static boolean isProd() {
        return isEnvironment("prod");
    }
    public static boolean isEnvironment(String key) {
        String[] activeProfiles = SpringUtils.getActiveProfiles();
        for(String p:activeProfiles) {
            if(p.contains(key)) {
                return true;
            }
        }
        return false;
    }
}
